import request from '/@/utils/request';

export function fetchList(params) {
  return request({
    url: '/bum/dimdept/tree',
    method: 'get',
    params
  })
} 
//查询未注册的设备
export function getUnRegisterDevList() {
  return request({
    url: '/bum/regdev/unRegisterDev',
    method: 'get', 
  })
} 
//新增
export function addList(params) {
  return request({
    url: '/bum/dimdept',
    method: 'post',
    data: params
  })
}
//修改
export function editList(params) {
  return request({
    url: '/bum/dimdept',
    method: 'put',
    data: params
  })
} 
//删除
export function delList(ids) {
  return request({
    url: '/bum/dimdept',
    method: 'delete',
    data: ids,
  })
}  
//根据部门id查询部门内所有表计
export function getDimdept(id) {
  return request({
    url: '/bum/dimdept/'+id,
    method: 'get', 
  })
}
//保存关联表计
export function addDimdept(params) {
   return request({
    url: '/bum/dimdept/saveDevDeptMap',
    method: 'post', 
    data: params
  })
}
//保存关联分区
export function addDimdeptArea(params) {
  return request({
    url: '/bum/dimdept/saveSubareaDeptMap',
    method: 'post', 
    data: params
  })
}
//获取分区树形结构数据
export function getAreaTree(obj) {
  return request({
    url: '/bm/bamssubarea/treeDataScope',
    method: 'get'
  })
}
//根据节点查表计
export function getMeter(params) {
  return request({
    url: '/bum/dimdept/meter',
    method: 'get',
    params
  })
}